package edu.hunau.cxb19.oop.class05.hk;

import java.util.Arrays;

/**
 *
 * @author hb
 *
 *         2020-02-28 15:20:14
 */
public class MultiQuestion extends Question {
	private char[] answers;

	/**
	 * 
	 */
	public MultiQuestion() {
	
	}

	@Override
	public boolean check(char[] answers) {
		// 对用户的答案和标准答案进行排序
		Arrays.sort(answers);
		Arrays.sort(this.answers);

		return Arrays.equals(answers, this.answers);
	}

	/**
	 * @param id
	 * @param options
	 * @param text
	 */
	public MultiQuestion(int id, String[] options, String text, char[] answers) {
		super(id, options, text);
		setAnswers(answers);

	}

	/**
	 * @return the answers
	 */
	public char[] getAnswers() {
		return answers;
	}

	/**
	 * @param answers the answers to set
	 */
	public void setAnswers(char[] answers) {
		this.answers = answers;
	}

}
